from base import BaseHandler

import urlparse
import urllib

class LoginHandler(BaseHandler):
	def get(self):
		parent = self.request.get('parent')
		default_url = urlparse.urljoin(self.request.url, '/')
		url = urlparse.urljoin(default_url, '/redirect/' + urllib.quote(parent)) if parent != '' else default_url
		self.render_template('login.html', {'continue': url })
